package main

import (
	"fmt"
	"reflect"
)

type Second int
type Person struct {
	Name string
	Age  int
}

func main() {
	fmt.Println("var s Second")
	var s Second = 100
	t := reflect.TypeOf(s)
	fmt.Printf("s.Type.String: %v\n", t.String())
	fmt.Printf("s.Type: %v\n", t)
	k := t.Kind()
	fmt.Printf("s.Type.kind: %d:%v\n", k, k)
	fmt.Println()

	v := reflect.ValueOf(s)
	fmt.Printf("s.Value.String: %v\n", v.String())
	fmt.Printf("s.Value: %v\n", v)
	fmt.Println()

	k = v.Kind()
	fmt.Printf("s.Value.Kind: %d:%v\n", k, k)
	fmt.Println()

	fmt.Println(`var p = Person{"allen", 19}`)
	var p = Person{"allen", 19}
	t = reflect.TypeOf(p)
	fmt.Printf("p.Type.String): %v\n", t.String())
	fmt.Printf("p.Type: %v\n", t)
	k = t.Kind()
	fmt.Printf("p.Type.kind: %d:%v\n", k, k)
	fmt.Println()
	v = reflect.ValueOf(p)
	fmt.Printf("p.Value.String: %v\n", v.String())
	fmt.Printf("p.Value: %v\n", v)
	fmt.Println()
	k = v.Kind()
	fmt.Printf("s.Value.Kind: %d:%v\n", k, k)
	fmt.Println()

}
